package com.niiwoo.civet.trade.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description: 标的子状态枚举
 * @Author:bincun  通过设置子状态，自动关联出父状态 ，不得单独设置父状态
 * @Date:2017/11/10
 */
@Getter
@AllArgsConstructor
public enum ProjectSubStatusEnum {
    //1审核中
    CHECKING_INIT(100,"审核中-初始",ProjectStatusEnum.CHECKING,"您的借款正常审核中，请您耐心等候"),
    CHECKING_BACK(101,"审核中-借款审核退回",ProjectStatusEnum.CHECKING,"你的借款资料不完善，请完善后再次提交"),
    CHECKING_LOAN_FAKE_PASS(102,"借款反欺诈-通过",ProjectStatusEnum.CHECKING,"您的借款正常审核中，请您耐心等候"),
    CHECKING_AUTO_SUCCESS(103,"自动审核-通过",ProjectStatusEnum.CHECKING,"您的借款正常审核中，请您耐心等候"),
    CHECKING_AUTO_MANUAL(104,"自动审核-人工审核",ProjectStatusEnum.CHECKING,"您的借款正常审核中，请您耐心等候"),
    CHECKING_MANUAL_SUCCESS(105,"人工审核-通过",ProjectStatusEnum.CHECKING,"您的借款正常审核中，请您耐心等候"),
    CHECKING_FOR_CONFIRM(106,"审核通过-待确认",ProjectStatusEnum.CHECKING,"您的借款审核已审核通过，需要您再次确认借款信息"),
    CHECKING_BACK_PHONEOPERATOR_TIMEOUT(107,"借款退回-运营商数据获取超时",ProjectStatusEnum.CHECKING,"你的借款资料不完善，请完善后再次提交"),
    CHECKING_BACK_ADDRESSLIST_TIMEOUT(108,"借款退回-通讯录回流超时",ProjectStatusEnum.CHECKING,"你的借款资料不完善，请完善后再次提交"),
    CHECKING_MANUAL_FIRST(109,"人工审核-初审",ProjectStatusEnum.CHECKING,"您的借款正常审核中，请您耐心等候"),
    CHECKING_MANUAL_LAST(110,"人工审核-终审",ProjectStatusEnum.CHECKING,"您的借款正常审核中，请您耐心等候"),
    CHECKING_MANUAL_BACK_FIRST(111,"人工审核-打回初审",ProjectStatusEnum.CHECKING,"您的借款正常审核中，请您耐心等候"),
    CHECKING_CREDIT_AMOUNT(112,"天秤额度评分卡-通过",ProjectStatusEnum.CHECKING,"您的借款正常审核中，请您耐心等候"),
    CHECKING_FOR_CONFIRMED(113,"审核通过-已确认",ProjectStatusEnum.CHECKING,"您的借款已审核通过，等待发布中。"),

    //2筹款中
    COLLECTING_INIT(200,"筹款中-投资中",ProjectStatusEnum.COLLECTING,""),
    COLLECTING_LENDING(201,"筹款中-放款中",ProjectStatusEnum.COLLECTING,""),

    //3还款中
    REPAYING_INIT(300,"还款中-正常还款中",ProjectStatusEnum.REPAYING,"还款日20:00前，请确保你我金融账户或已开通代扣银行卡余额充足（银行卡尾号{0}）"),
    REPAYING_OVERDUE(301,"还款中-逾期还款中",ProjectStatusEnum.REPAYING,"您的还款已逾期{0}天，请尽快还款，避免影响个人信用及产生额外费用"),
    REPAYING_BAD(302,"还款中-坏账还款中",ProjectStatusEnum.REPAYING,"您的还款已逾期{0}天，项目已停止，请尽快还款，避免影响个人信用及产生额外费用"),

    //4已结清
    FINISH_NORMAL(400,"已结清-正常结清",ProjectStatusEnum.FINISH,"还款已结清，让你的信用更有价值，请继续保持良好信用"),
    FINISH_ADVANCE(401,"已结清-提前结清",ProjectStatusEnum.FINISH,"还款已结清，让你的信用更有价值，请继续保持良好信用"),
    FINISH_BAD(402,"已结清-坏账结清",ProjectStatusEnum.FINISH,"逾期还款已结清"),
    FINISH_OVERDUE(403,"已结清-逾期结清",ProjectStatusEnum.FINISH,"逾期还款已结清"),

    //5已流标
    MISCARRY_AUTO_FAILED(500,"流标-自动审核不通过",ProjectStatusEnum.MISCARRY,"借款资质不符合平台要求"),
    MISCARRY_MANUAL_FAILED(501,"流标-人工审核不通过",ProjectStatusEnum.MISCARRY,""),
    MISCARRY_BACK_OVERTIME(502,"流标-借款退回超时未处理",ProjectStatusEnum.MISCARRY,"你的借款资料不完善，请完善后再次提交"),
    MISCARRY_CANCER_BORROWER(503,"流标-借款人手动取消",ProjectStatusEnum.MISCARRY,""),
    MISCARRY_INVEST_OVERTIME(504,"流标-投资超时",ProjectStatusEnum.MISCARRY,""),
    MISCARRY_CANCER_MANAGER(505,"流标-管理人员手动取消",ProjectStatusEnum.MISCARRY,""),
    MISCARRY_LOAN_FAKE_FAILED(506,"流标-借款反欺诈不通过",ProjectStatusEnum.MISCARRY,"借款资质不符合平台要求"),
    MISCARRY_LOAN_BATCH(507,"管理员批量流标",ProjectStatusEnum.MISCARRY,""),
    MISCARRY_PUSH_FAIL(508,"存管上标失败",ProjectStatusEnum.MISCARRY,""),
    MISCARRY_R360_TIMEOUT_UNCONFIRMED(509,"流标-融360超时未确认",ProjectStatusEnum.MISCARRY,""),
    MISCARRY_CREDIT_AMOUNT(510,"流标-授信额度低于起借金额",ProjectStatusEnum.MISCARRY,""),
    MISCARRY_CONFIRMED_OVERTIME(511,"流标-审核通过待确认超时未处理",ProjectStatusEnum.MISCARRY,""),
    ;

    private int subStatus;
    private String desc;
    private ProjectStatusEnum parentStatusEnum;
    private String msg;


    public static ProjectSubStatusEnum enumOf(int subStatus) {
        for (ProjectSubStatusEnum retEnum : values()) {
            if (retEnum.subStatus == subStatus) {
                return retEnum;
            }
        }
        return null;
    }
}
